Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LXD Network Checks and API Logging #8964

Closed
wants to merge 3 commits into from

Conversation

manadart
Copy link
Member

Description of change

When observing controller logs, it became apparent that the info level logging was unnecessarily frequent for:

  • Checks for usable network devices on the default profile.
  • Logging the current LXD API version.

This PR does the following:

  • Relocates the network device check to be done prior to container creation. This means that for all other instance checking, tear-down etc, the check is not made (or logged).
  • Changes the API version logging level from "info" to "debug".

QA steps

Bootstrap and add some machines. Tail the controller debug log and ensure that the logs indicate the changed level/frequency. Kill the controller and ensure that there are no network checks.

Documentation changes

None.

Bug reference

N/A

@manadart
Copy link
Member Author

I am almost inclined to remove the API level logging. It is not always like this, but it doesn't add much value:

machine-0: 12:34:55 DEBUG juju.worker.lease [50f7d1] no leases to expire
machine-0: 12:34:56 DEBUG juju.provider.lxd using LXD API version "1.0"
machine-0: 12:34:56 DEBUG juju.provider.lxd using LXD API version "1.0"
machine-0: 12:34:56 DEBUG juju.provider.lxd using LXD API version "1.0"
machine-0: 12:34:56 DEBUG juju.state merged endpoint bindings modified: false, default: map[], old: map[], new: map[], result: map[]
machine-0: 12:34:56 DEBUG juju.apiserver <- [3] machine-0 {"request-id":194,"type":"InstancePoller","version":3,"request":"InstanceId","params":"'params redacted'"}
machine-0: 12:34:56 DEBUG juju.apiserver -> [3] machine-0 960.635µs {"request-id":194,"response":"'body redacted'"} InstancePoller[""].InstanceId
machine-0: 12:34:56 DEBUG juju.provider.lxd using LXD API version "1.0"

@manadart
Copy link
Member Author

@SimonRichardson SimonRichardson self-requested a review July 24, 2018 10:52
@manadart manadart changed the title Lxd logging net checks LXD Network Checks and API Logging Jul 24, 2018
Copy link
Member

@SimonRichardson SimonRichardson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much better, we don't have to branch as much and it keeps the codebase more consistent.

@manadart
Copy link
Member Author

$$merge$$

@manadart manadart closed this Jul 25, 2018
jujubot added a commit that referenced this pull request Aug 28, 2018
#9110

## Description of change

When using lxd 2.0.x that doesn't support api network extensions, 
the latest juju will fail because it can't find the configuration file 
inside the container. 

In current develop for Juju LXD 2.0.x will not bootstrap, the following
code will now bootstrap to LXD 2.0.x.

## QA steps

Install lxd 2.0 either via snap or apt-get, making sure that
you remove your current lxd 3.0 and your current lxd 2.0
setup. (this only presents itself on a clean install).

Installing lxd 2.0 for xenial:

```sh
sudo apt-get install lxd=2.0.11-0ubuntu1~16.04.4
```

```sh
juju bootstrap localhost test
```

## Bug reference

https://bugs.launchpad.net/juju/+bug/1788805

## Notes

This PR supersedes #8964
@manadart manadart deleted the lxd-logging-net-checks branch October 20, 2023 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants